GtkApplication: Do not assert sm_proxy != NULL in inhibit functions
authorMatt Barnes <mbarnes@redhat.com>
Sun, 28 Jul 2013 20:09:58 +0000 (16:09 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 28 Jul 2013 20:09:58 +0000 (16:09 -0400)
commit0e350eeea6d962f9edb4a381b7388166d99e2763
tree19075ad0d31f13e6ae20416afd8bb01e79adbcc1
parentc9ce98714da965062f514aa0ec8092a40bbe087a
GtkApplication: Do not assert sm_proxy != NULL in inhibit functions

Applications have no way of finding out if a session manager proxy was
successfully created in gtk_application_startup_session_dbus(), so it's not
appropriate for certain public GtkApplication functions to be asserting the
presence of a session manager proxy as if it were a programmer error.

This affects:

   gtk_application_inhibit()
   gtk_application_is_inhibited()

If sm_proxy is NULL, the function should just return silently.

In the case of gtk_application_uninhibit(), the application should only be
calling this if it obtained a valid cookie, which implies the presence of a
session manager proxy.  I noted that with a comment.

https://bugzilla.gnome.org/show_bug.cgi?id=701365
gtk/gtkapplication.c